←Select platform

CompareText(IList<DocumentPageText>) Method

Summary

Compares a list of DocumentPageText objects

Syntax
C#
VB
C++
public IList<TextDifference> CompareText( 
   IList<DocumentPageText> pages 
) 
Public Function CompareText( 
   ByVal pages As IList(Of DocumentPageText 
)) As IList(Of TextDifference) 
public:  
   IList<TextDifference^>^ CompareText( 
      IList<DocumentPageText^>^ pages 
   ) 

Parameters

pages

List of DocumentPageText objects to compare.

Return Value

A list of TextDifferences.

Remarks

Exactly two DocumentPageText objects must be provided.

This method will compare the DocumentPageText objects and return just the TextDifferences. If you are interested in the positional information for the differences, use the CompareDocumentPage method instead.

Example
C#
using Leadtools.Document; 
using Leadtools.Document.Compare; 
using Leadtools; 
 
 
public void CompareTextDocumentPageTextExample() 
{ 
   var doc1 = DocumentFactory.LoadFromFile(pathToDocument1, new LoadDocumentOptions()); 
   var doc2 = DocumentFactory.LoadFromFile(pathToDocument2, new LoadDocumentOptions()); 
 
   var textList = new List<DocumentPageText>() 
   { 
      doc1.Pages.First().GetText(), 
      doc2.Pages.First().GetText() 
   }; 
 
   var comparer = new DocumentComparer(); 
   var diffs = comparer.CompareText(textList); 
 
   foreach (TextDifference diff in diffs) 
   { 
      Console.WriteLine($"Operations: {diff.Operation}"); 
      Console.WriteLine($"Text: {diff.Text}"); 
      Console.WriteLine("--------"); 
   } 
} 
Requirements
Target Platforms
Help Version 21.0.2021.7.19
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Document.Compare Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.